package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Yummy
 * @version 1.0
 */
@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查询套餐的数量
     * @param ids
     * @return
     */
    Integer countByDishIds(List<Long> ids);

    /**
     * 批量插入setmealId对应的菜品
     * @param dishes
     * @param setmealId
     */
    void batchInsert(List<SetmealDish> dishes, Long setmealId);

    /**
     * 根据套餐id批量删除
     * @param setmealIds
     */
    void deleteBySetmealIds(List<Long> setmealIds);

    /**
     * 根据套餐id查询套餐菜品信息
     * @param setmealId
     * @return
     */
    List<SetmealDish> queryBySetmealId(Long setmealId);

    /**
     * 根据套餐id删除
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
